package com.enjoyor.soa.traffic.core.tsms.mapper.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.enjoyor.soa.traffic.core.tsms.constant.CommonRouteSqlId;
import com.enjoyor.soa.traffic.core.tsms.constant.RoutePointSqlId;
import com.enjoyor.soa.traffic.core.tsms.domain.CommonRoute;
import com.enjoyor.soa.traffic.core.tsms.domain.RoutePoint;
import com.enjoyor.soa.traffic.core.tsms.mapper.IRoutePointMapper;
import com.enjoyor.soa.traffic.frame.support.mybatis.mapper.impl.BaseMapper;
import com.enjoyor.soa.traffic.util.pojo.Page;

@Service
@Transactional
public class RoutePointMapper extends BaseMapper<RoutePoint> implements IRoutePointMapper {

	@Override
	public Page getToutePointPage(Page page) {
		// TODO Auto-generated method stub
		return this.selectPageInfo(getSqlName(RoutePointSqlId.SQL_SELECT_ALL), page);
	}

	@Override
	public List<RoutePoint> getRoutePointList(Map map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.selectList(getSqlName(RoutePointSqlId.SQL_SELECT_LIST), map);
	}

	@Override
	public int deleteRoutePoint(Map map) {
		// TODO Auto-generated method stub
		int num = sqlSessionTemplate.delete(getSqlName(RoutePointSqlId.SQL_DELETE_POINT), map);
		return num;
	}
	
	@Override
	public int deleteByRouteId(String routeId){
		// TODO Auto-generated method stub
		int num = sqlSessionTemplate.delete(getSqlName(RoutePointSqlId.SQL_DELETE_BY_ROUTEID), routeId);
		return num;
	}
}